package cn.edu.zju.om.analyse;

import java.util.List;

class Helper {
	
	private Helper() {
	}
	
	public static void assertArrayNoNaN(double[] array) throws Exception {
		for(double num : array) {
			if (Double.isNaN(num)) {
				throw new Exception("There is NaN in the array");
			}
		}
	}
	
	public static void assertArrayNoLessThanOne(double[] array) {
		for(double num : array) {
			if (num > 0 && num < 1) {
				System.out.println("Less than one!");
			}
		}
	}
	
	public static void assertFeatureVectors(List<PhraseFeatureVector> vectors) {
		for(PhraseFeatureVector vector : vectors) {
			double[] array = vector.getFeatureVector();
			
//			/Helper.assertArrayNoNaN(array);
			Helper.assertArrayNoLessThanOne(array);
		}
	}

}
